/*
 * Copyright (c) 2006 - 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;

/**
 * <p>Project: app2022 - Nio5
 * <p>Powered by webrx On 2022-01-20 11:41:53
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Nio5 {
    public static void main(String[] args) throws IOException {
        //读取字符文件
        var p = Paths.get("C:\\app2022\\08io\\src\\main\\java\\cn\\webrx\\Nio5.java");
        List<String> text = Files.readAllLines(p);
        //System.out.println(text);
        text.forEach(System.out::println);

        //读取字节byte[]
        var b = Files.readAllBytes(Paths.get("p33.jpg"));
        //写入文件
        Files.write(Paths.get("p44.jpg"), b);
    }
}
